<?php
// đường dẫn gốc

defined('APPLICATION_PATH')
    || define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/'));

defined('LIBRARIES_PATH')
    || define('LIBRARIES_PATH', "C:\wamp\www\Libraries");
defined('USERS_LIBRARIES_PATH')
    || define('USERS_LIBRARIES_PATH', "/home/huynguyen/libraries");
//
// load thư viện

set_include_path(implode(PATH_SEPARATOR, array(
    realpath(LIBRARIES_PATH),
    get_include_path(),
)));
set_include_path(implode(PATH_SEPARATOR, array(
    realpath(USERS_LIBRARIES_PATH),
    get_include_path(),
)));

defined('APPLICATION_ENV')
    || define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : '1158'));
//
// include

require_once 'Zend/Application.php';
require_once 'Zend/Config/Ini.php';
//
// Load cấu hình

$application = new Zend_Application(
    APPLICATION_ENV,
    APPLICATION_PATH . '/system/system.ini'
);
$config = new Zend_Config_Ini(APPLICATION_PATH . '/system/system.ini', 'development');

if (!defined('BASE_URL')) {
    define('BASE_URL', $config->setting->baseurl);
}
if (!defined('UPLOAD_PATH')) {
    define('UPLOAD_PATH', $config->setting->newsimagefolder);
}
if (!defined('SESSION_NSPACE')) {
    define('SESSION_NSPACE', $config->setting->session_nspace);
}
if (!defined('SECURE_HASH')) {
    define('SECURE_HASH', $config->setting->secure_hash);
}
$application->bootstrap()
    ->run();
?>